package com.lcxw.hxzb.friendcircle.project.system.controller;

import com.lcxw.hxzb.friendcircle.framework.web.controller.BaseController;
import com.lcxw.hxzb.friendcircle.framework.web.domain.AjaxResult;
import com.lcxw.hxzb.friendcircle.framework.web.page.TableDataInfo;
import com.lcxw.hxzb.friendcircle.project.system.domain.YwpdGamelevel;
import com.lcxw.hxzb.friendcircle.project.system.service.IYwpdGamelevelService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 陪玩游戏等级Controller
 * 
 * @author ruoyi
 * @date 2020-09-15
 */
@RestController
@Api(tags = "陪玩游戏等级Controller")
@RequestMapping("/system/gamelevel")
public class YwpdManageGamelevelController extends BaseController
{
    @Autowired
    private IYwpdGamelevelService ywpdGamelevelService;

    /**
     * 查询陪玩游戏等级列表
     */
    @GetMapping("/list")
    public TableDataInfo list(YwpdGamelevel ywpdGamelevel)
    {
        startPage();
        List<YwpdGamelevel> list = ywpdGamelevelService.selectYwpdGamelevelList(ywpdGamelevel);
        return getDataTable(list);
    }

    /**
     * 获取陪玩游戏等级详细信息
     */
    @GetMapping(value = "/{levelId}")
    public AjaxResult getInfo(@PathVariable("levelId") Long levelId)
    {
        return AjaxResult.success(ywpdGamelevelService.selectYwpdGamelevelById(levelId));
    }

    /**
     * 新增陪玩游戏等级
     */
    @PostMapping
    public AjaxResult add(@RequestBody YwpdGamelevel ywpdGamelevel)
    {
        return toAjax(ywpdGamelevelService.insertYwpdGamelevel(ywpdGamelevel));
    }

    /**
     * 修改陪玩游戏等级
     */
    @PutMapping
    public AjaxResult edit(@RequestBody YwpdGamelevel ywpdGamelevel)
    {
        return toAjax(ywpdGamelevelService.updateYwpdGamelevel(ywpdGamelevel));
    }

    /**
     * 删除陪玩游戏等级
     */
	@DeleteMapping("/{levelIds}")
    public AjaxResult remove(@PathVariable Long[] levelIds)
    {
        return toAjax(ywpdGamelevelService.deleteYwpdGamelevelByIds(levelIds));
    }
}
